const router = require('koa-router')();
const {showMusics, showEdit, addMusic, editMusic, delMusic} = require('../controller/music');

router.prefix('/music');

router.get('/index', showMusics);

router.get('/add', async ctx => ctx.render('add'));

router.get('/edit', showEdit);

router.post('/addMusic', addMusic);

router.put('/editMusic', editMusic);

router.delete('/delMusic', delMusic);

module.exports = router;
